import axios from "axios";

//创建默认axios实例

var instance = axios.create({
  // baseURL:'http://api',
  timeout:5000,
});

//请求拦截器
instance.interceptors.request.use(config=>{
  console.log("请求拦截器");
  return config;
});

//响应拦截器
instance.interceptors.response.use(response=>{
  console.log("响应拦截器");
  return response;
},error => { //响应出现错误时进入此
  console.log("err");
});

export default instance;
